1. Field of the Invention
The present invention relates to a correction technique for use in conversion of color image data received from an input device into color image data adapted for an output device.
2. Description of the Related Art
In the field of photographic processing, in general, input color image data obtained by reading an image on a photographic film by e.g. a scanner has a greater gradation range (greater color depth) than output color image data (to be outputted for monitor display, printing etc.) For instance, 12-bit input color image data (hereinafter, referred to as “input image data” when appropriate) is generally subjected to a bit conversion into 8-bit output color image data (hereinafter, referred to as “output image data” when appropriate).
The greater gradation range of the input image data than the output image data is provided for the following reasons. Namely, the negative film is provided with a very wide density descriptive range and it is desired to render this wide range of density information of the negative film into data having maximum fidelity thereto. Conversely, the gradation range of the output image data is adapted to the color development characteristics of the print paper. And, the very wide density descriptive range of the negative film is provided for making an appropriate photography possible even with a simple inexpensive camera (e.g. one-use camera) without exposure adjustment function, thereby to facilitate photography by an unskilled or inexperienced amateur photographer.
Further, in case the bit conversion is effected for converting the input image data into the output image data, in order to allow the gradation change in the input image data to be reproduced as it is in the output image data, a mathematical function such as one shown in FIG. 4 is employed for directly converting the gradation in the distribution range of the input image data into the gradation of the output image data, thereby to effect conversion from the 12-bit data into 8-bit data.
On the other hand, by effecting various processing on the digital image data, it is possible to correct the density or color depth of an image to be reproduced from the output image data (see e.g. Japanese Patent Application “Kokai” No.: Hei. 11-331596 and Japanese Patent Application “Kokai” No.: 2002-44422). In this respect, there are a variety of techniques currently available for the density correction to be effected on the digital image data. One commonly employed method is shifting the position of the mathematical function (referred to as “correction function” hereinafter). For instance, if it is desired to obtain a greater density for an entire output image to be obtained from a correction function shown in FIG. 4, the density correction is made after shifting the correction function to the right as illustrated in FIG. 5. With this shifting of the function, output gradation to be obtained from each input gradation can be adjusted, so that output image data of a variety of densities can be obtained from a single input image data.
With the above-described density correction, however, as also illustrated in FIG. 5, within the possible distribution range of the input image data, it is possible that some input gradation values thereof may be converted into correction values which deviate from the possible range of the output gradation values. That is, in the correction function shown in FIG. 5, normal or appropriate values cannot be outputted from those input gradation values corresponding to the portions denoted with bold line segments. Namely, when the correction function is shifted as described above, the correction value cannot be outputted as it is as a gradation value if this correction value overflows from a maximum output gradation value or underflows from a minimum output gradation value.
Therefore, the digital image data cannot be obtained unless all correction values overflowing from the possible output gradation range are forcibly converted into the same maximum output gradation value (into 255 in the case of 8 bit data) and all correction values underflowing from the possible output gradation range are forcibly converted into the same minimum output gradation value (0) (this process will be referred to as “chopping” hereinafter). In this, in the conversion of the input image data into the output image data by suing the above-described correction function, if the chopping is effected for digital image data of at least one color component, the chopping may result in disturbance or loss of the original color balance among the output image data of the respective color components.
For example, let us now suppose that the above-described correction function is a linear function having a positive proportional constant and this function is used in bit conversion of one pixel data (one set of pixel color values) of 12-bit input image data: (B, G, R)=(200, 250, 300) into 8-bit output image data. This case will be described next.
(a) in case the position of the correction function is set to cause an input gradation value=200 to correspond to a maximum output gradation value=255:
With the above correction function, there are obtained correction values of: (b, g, r)=(255, 305, 355). In this, however, g=305 and r=355, respectively are out of the possible output range of gradation values. Hence, the above-described chopping is effected for g=305 and r=355, respectively. With this, the output gradation values of: (B, G, R)=(255, 255, 255) are eventually obtained. Accordingly, the original color balance is disturbed in the output image data.
(b) in case the position of the correction function is set so as to cause the input gradation value=250 to correspond to a maximum output gradation value=255:
With the above correction function, there are obtained correction values of: (b, g, r)=(205, 255, 300). In this, however, r=300 overflows from the possible output range of gradation values. Hence, the chopping is effected for this r=300. With this, the output gradation values of: (B, G, R)=(205, 255, 255) are eventually obtained. Again, the original color balance is disturbed in the output image data.
(c) in case the position of the correction function is set so as to cause the input gradation value=300 to correspond to a maximum output gradation value=255:
With the above correction function, there are obtained correction values of: (b, g, r)=(155, 205, 255). In this case, the respective correction values are confined within the possible output gradation range. Hence, no chopping is effected. Therefore, the output gradation is (B, G, R)=(155, 205, 255) and the original color balance is maintained.
As described above, if a correction value obtained from input image data of at least one color component of B, G, R is converted to a maximum output gradation value or a minimum output gradation value through the chopping, there occurs of loss or disturbance in the color balance.
Another problem may occur in the course of the conversion of color image data during a photographic processing as described next. In general, in image data obtained from a photographic film, a CD-ROM or the like, each pixel data is described in the RGB color system. However, its image quality adjustment is effected in such a manner that the hue and the luminance is varied independently of each other. Hence, if such adjustment is effected in the RGB color system, the respective color components need to be adjusted with maintaining good balance among them. Therefore, this adjustment operation tends to be extremely difficult. For this reason, according to a generally practiced technique, for the image quality adjustment, the image data described in the RGB color system are converted into a different color system such as the YCC color system (color space) which allows easier image quality adjustment and the image quality adjustment is effected in that different color space. Upon completion of the adjustment in the YCC color space for instance, the image data is then reversely converted into the RGB color system to be outputted, that is, to be exposed on a print paper or displayed on a monitor.
However, in the case of the RGB color system describing in the gradation range of 0˜255, depending on the amount of adjustment made in the YCC color space, it may happen that a post-conversion value of a color component constituting the pixel data may become e.g. 280 overflowing from the maximum gradation value of 255 or may become e.g. −30 underflowing from the minimum gradation value of 0, such that the pixel data reversely converted into the RGB color system may not be fitted within the predetermined gradation range.
In the case of the conventional photographic processing apparatus, the chopping is effected. Namely, for pixel data overflowing from the maximum gradation value, the value of the overflowing color component is forcibly set to the maximum value of 255 of the gradation range or for pixel data underflowing from the minimum gradation value the value of the underflowing color component is forcibly set to the minimum value of 0 of the gradation range.
With the above-described chopping, however, for instance, color image data: (R, G, B)=(280, 240, 150) are “corrected” to color image data: (R, G, B)=(255, 240, 150). Therefore, in this case too, there occurs disturbance in the color balance before and after the correction. And, this results in change in the hue originally present in the image data, thus inviting reduction in the color reproducibility.